<template>
  <div>
    <router-view></router-view>
    <van-tabbar v-model="active">
      <van-tabbar-item icon="home-o" to="/manager/home">首页</van-tabbar-item>
      <van-tabbar-item icon="orders-o" to="/manager/order"
        >订单</van-tabbar-item
      >
      <van-tabbar-item icon="service-o" to="/manager/earning"
        >收入</van-tabbar-item
      >
      <van-tabbar-item icon="friends-o" to="/manager/mine"
        >我的</van-tabbar-item
      >
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: 0,
    };
  },
  created() {
    let path = window.location.pathname;
    if (path == "/manager/home") {
      this.active = 0;
    } else if (path == "/manager/order") {
      this.active = 1;
    } else if (path == "/manager/earning") {
      this.active = 2;
    } else if (path == "/manager/mine") {
      this.active = 3;
    }
  },
};
</script>

<style lang="sass" scoped>
</style>